package com.tjbank.cssys.web.controller;

import com.tjbank.cssys.api.SequenceService;

import com.tjbank.cssys.web.config.GetUserCodeFromToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.UUID;

/**
 * 自定义组织树编号生成器
 * 
 * Package : com.tansun.magicube.iam.web.controller
 * 
 * @author -- lijiangtao 2020年5月7日 下午8:04:41
 *
 */
@RestController
public class SequenceController {

    @Autowired
    private SequenceService sequenceService;

     private static final Logger logger = LoggerFactory.getLogger(SequenceController.class);

    /**
     * 根据编码前缀获取新编码
     * 
     * @param prefix
     * @return
     * @author -- lijiangtao 2020年5月7日 下午8:06:39
     */
    @GetMapping("/getNextVal")
    public String getNextVal(String prefix , HttpServletRequest request ) {


        return sequenceService.getNextVal(prefix);
    }
}
